﻿using DAL;
using DAL.Dao;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public  class MessageImpl
    {
        private static MessageDaoimpl _dao;
        public int ExistNum { get { return _dao.ExistNum; } private set { } }

        public MessageImpl()
        {
            if (_dao == null) _dao = new MessageDaoimpl();
        }
        public Message GetMessageInfo(int id)
        {
            return _dao.GetMessageInfo(id);
        }
        public IList<Message> GetMessageInfoList(int userID)
        {
            return _dao.GetMessageInfoList(userID);
        }
        public (int,IList<Message>) GetMessageInfoList(int userID,int rows,int page)
        {
            return _dao.GetMessageInfoList(userID,rows,page);
        }

        public (int, IList<Message>) GetList(int rows, int page)
        {
            return _dao.GetList(rows, page);
        }

        public bool Delete(int id)
        {
            return _dao.Delete(id);
        }

        public int Add(Message message)
        {
            return _dao.Add(message);
        }
        public void Dispose()
        {
            _dao.Dispose();
        }
    }
}
